package main

import (
	"fmt"

	"gitee.com/wu-jin-feng/fgin"
	"github.com/streadway/amqp"
)

func main() {
	f := fgin.Fgin{}
	r := f.GetHttpServer("./test.yaml")
	// 消费者1
	mqObj1, err := fgin.DefaultQueue("frabbitmq_queue_test1")
	if err != nil {
		panic(err)
	}
	mqObj1.DefaultConsumer(func(msg amqp.Delivery) error {
		fmt.Printf("%+v, %+s\n", msg.ContentType, msg.Body)
		return nil
	})
	// 消费2
	mqObj2, err := fgin.DefaultQueue("frabbitmq_queue_test2")
	if err != nil {
		panic(err)
	}
	mqObj2.DefaultConsumer(func(msg amqp.Delivery) error {
		fmt.Printf("%+v, %+s\n", msg.ContentType, msg.Body)
		return nil
	})

	f.Run(r)
}
